package cn.wgx.common.util;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * spring获取bean工具类
 * 继承并拓展hutool的
 *
 * @author 作者 wgx
 * @version 创建时间：2021.4.8
 *
 */
@Component
public class SpringUtils extends SpringUtil {

	public static String getProperty(String key) {
		return getApplicationContext().getBean(Environment.class).getProperty(key);
	}

}
